/*
class Solution {
public:
    int minSubArrayLen(int target, vector<int>& nums) {
        int ret = INT_MAX;
        int sum = 0;
        for (int left = 0, right = 0; right < nums.size(); right ++)
        {
            sum += nums[right];
            while (sum >= target)
            {
                ret = min(ret, right - left + 1);
                sum -= nums[left ++];
            }
        }
        return ret == INT_MAX ? 0 : ret;
    }
};
*/
/*
class Solution {
public:
    int lengthOfLongestSubstring(string s) {
        int len = 0;
        int hash[128] = { 0 };
        for (int left = 0, right = 0; right < s.size(); right ++)
        {
            hash[s[right]] ++;
            while(hash[s[right]] > 1)
            {
                hash[s[left]] --;
                left ++;
            }
            len = max(len, right - left + 1);
        }
        return len;
    }
};
*/
/*
class Solution {
public:
    int lengthOfLongestSubstring(string s) {
        int ret = 0;
        for (int left = 0; left < s.size(); left ++)
        {
            int hash[128] = { 0 };
            for (int right = left; right < s.size(); right ++)
            {
                hash[s[right]] ++;
                if (hash[s[right]] > 1)  break;
                ret = max(ret, right - left + 1);
            }
        }
        return ret;
    }
};
*/
